
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module MessageUtil
* @author: guojianbo
* @description: 工具类
* @since: 2018-07-23 12:45:29
*/
var log_1 = __webpack_require__(/*! ./log */ "./src/extra/utils/log.ts");
var MessageUtil = /** @class */ (function () {
    function MessageUtil() {
    }
    MessageUtil.prototype.getMessageArrayPrint = function (messages) {
        try {
            if (!messages || messages.length <= 0) {
                return 'messagesInfo{ count:0 }';
            }
            var ret = 'messagesInfo{' + ' count:' + messages.length;
            for (var i = 0; i < messages.length; i++) {
                if (i > 1000) {
                    break;
                }
                var message = messages[i];
                ret += ' message{' + ' uuid:' + message.uuid + ' mid:' + message.mid + ' }';
            }
            ret += ' }';
            return ret;
        }
        catch (error) {
            log_1.default.error('MessageUtil::getMessageArrayPrint error:' + error);
            return '';
        }
    };
    MessageUtil.prototype.getSessionArrayPrint = function (sessions) {
        try {
            if (!sessions || sessions.length <= 0) {
                return 'sessionsInfo{ count:0 }';
            }
            var ret = 'sessionsInfo{' + ' count:' + sessions.length;
            for (var i = 0; i < sessions.length; i++) {
                if (i > 1000) {
                    break;
                }
                var session = sessions[i];
                ret += ' session{'
                    + ' type:' + session.type
                    + ' id:' + session.sessionId
                    + ' uuid:' + (session.message ? session.message.uuid : '')
                    + ' mid:' + (session.message ? session.message.mid : '')
                    + ' }';
            }
            ret += ' }';
            return ret;
        }
        catch (error) {
            log_1.default.error('MessageUtil::getSessionArrayPrint error:' + error);
            return '';
        }
    };
    return MessageUtil;
}());
exports.default = new MessageUtil();


//# sourceURL=webpack://MTDX/./src/extra/utils/message-util.ts?